<% keys.each do |key| -%>
resource "aws_kms_key" "<%= module_name_of(key) %>" {
    description             = "<%= key.description %>"
    key_usage               = "<%= key.key_usage %>"
    is_enabled              = <%= key.enabled %>
    enable_key_rotation     = <%= key_rotation_status_of(key).key_rotation_enabled %>

    policy = <<POLICY
<%= key_policy_of(key).strip %>
POLICY
}

<% end -%>
